From 80605be3afe9175d0de5048b312ba91ebc327415 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 28 Mar 2006 10:01:35 +0100 Subject: [PATCH] Simplify the failsafe callback handler in x86/64 linux. It doesn't need to try reloading segment selectors (unlike i386 linux). Signed-off-by: Keir Fraser --- .../arch/x86_64/kernel/entry-xen.S | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S index 6f797e457d..08b5f53f6a 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S @@ -855,32 +855,12 @@ ecrit: /**** END OF CRITICAL REGION ****/ # i.e. it just resumes from the next instruction interrupted with the same context. # Hypervisor uses this for application faults while it executes. +# Unlike i386 there is no need to reload the saved segment selectors: +# Xen already reloaded all valid ones and zeroed the others. ENTRY(failsafe_callback) - addq $0x10,%rsp /* skip rcx and r11 */ -1: mov (%rsp),%ds -2: mov 8(%rsp),%es -3: mov 16(%rsp),%fs -4: mov 24(%rsp),%gs - addq $0x20,%rsp /* skip the above selectors */ + addq $0x30,%rsp /* skip %rcx,%r11,%ds,%es,%fs,%gs */ SAVE_ALL jmp error_exit -.section .fixup,"ax"; \ -6: movq $0,(%rsp); \ - jmp 1b; \ -7: movq $0,8(%rsp); \ - jmp 2b; \ -8: movq $0,16(%rsp); \ - jmp 3b; \ -9: movq $0,24(%rsp); \ - jmp 4b; \ -.previous; \ -.section __ex_table,"a";\ - .align 16; \ - .quad 1b,6b; \ - .quad 2b,7b; \ - .quad 3b,8b; \ - .quad 4b,9b; \ -.previous #if 0 .section __ex_table,"a" -- 2.30.2